RMaxima

Date: 2013-08-15

Author: Sebastian Kranz

RMaxima is an interface between R and the computer algebra system Maxima. In addition the package has some functions for mathematical operations.

Installation under Windows

Sorry, so far the package is only tested under windows. You first must install Maxima separately. You should also add the /bin directory of Maxima to the Windows PATH variable.

You can install the package from GitHub in the usual fashion.

library(devtools)
install_github(repo="restorepoint", username="skranz")
install_github(repo="RMaxima", username="skranz")

Trying out

library(restorepoint)
library(RMaxima)

start.maxima()
mx.run("solve([x^2-y=0],x)", just.str=TRUE)

f = "x^2+y^2+x^2*y^2"
var = c("x","y")
mx.hessian(f=f,var=var)

Exchange between Maxima and R

Maxima code in R is stored as strings.

The interchange between R and Maxima uses intermediate files. The function mx.run works roughly as follows:

  1. It first wrap the plain Maxima code (ma) into Maxima output code (mao). Mao code are maxima commands that evaluate the plain ma code and write the results in the file mx$outfile.
  2. The mao code is sent to maxima via call.maxima(..). Either via an established Maxima pipe (default) or by calling maxima once from command line. The pipe solution is preferable, since it is quicker, but may currently not work on all operating systems.
  3. The generated output is retrieved with read.maxima.out and returned.


skranz/RMaxima documentation built on May 30, 2019, 1:08 a.m.